#!/usr/bin/env python
#    prop_socvir
#    ----------
#    Molecule:         H2O
#    Wave Function:    HF (6-31G)
#    Test Purpose:     Analysis of spin-spin coupling constants
#                      in terms of one occupied and one virtual
#                      orbital

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

f.add(string = 'Final HF energy',
      rel_tolerance = 1.0e-8)

f.add(string = 'Spin-spin couplings printed for atoms with abundance greater than',
      rel_tolerance = 1.0e-2)

f.add(string = 'Orbital analysis of spin-spin couplings',
      rel_tolerance = 1.0e-2)

f.add(from_string = 'DSO part of spin-spin coupling constant',
      to_string = 'TOTAL',
      abs_tolerance = 1.0e-3)

f.add(from_string = 'PSO part of spin-spin coupling constant',
      to_string = 'TOTAL',
      abs_tolerance = 1.0e-3)

f.add(from_string = 'FC part of spin-spin coupling constant',
      to_string = 'TOTAL',
      abs_tolerance = 1.0e-3)

f.add(from_string = 'SD(+FC) part of spin-spin coupling constant',
      to_string = 'TOTAL',
      abs_tolerance = 1.0e-3)

f.add(from_string = 'Total spin-spin coupling constant',
      to_string = 'TOTAL',
      abs_tolerance = 1.0e-3)

test.run(['prop_socvir.dal'], ['H2O.mol'], f={'out': f})

sys.exit(test.return_code)
